//
//  NetRequest+Menu.m
//  项目三
//
//  Created by rimi1 on 2016/11/25.
//  Copyright © 2016年 Wangxingqian. All rights reserved.
//

#import "NetRequest+Menu.h"

@implementation NetRequest (Menu)

@end

// 菜谱分类
@implementation NetRequest (MenuClassify)

+ (void)getMenuClassifyRequestSucceed:(Succeed)succeed
                              failure:(Failure)failure {
    NSString *httpUrl = [NSString stringWithFormat:@"%@%@", MENU_URL, @"classify"];
    [NetRequest getRequestWithUrl:httpUrl parameter:@{} succeed:^(id response) {
        succeed(response);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end
// 菜谱列表
@implementation NetRequest (MenuList)

+ (void)getMenuListRequestWithParameter:(NSDictionary *)parameter
                                succeed:(Succeed)succeed
                                failure:(Failure)failure {
    NSString *httpUrl = [NSString stringWithFormat:@"%@%@", MENU_URL, @"list"];
    [NetRequest getRequestWithUrl:httpUrl parameter:parameter succeed:^(id response) {
        succeed(response);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end
// 菜谱详情
@implementation NetRequest (MenuShow)

+ (void)getMenuShowRequestWithParameter:(NSDictionary *)parameter
                                succeed:(Succeed)succeed
                                failure:(Failure)failure {
    NSString *httpUrl = [NSString stringWithFormat:@"%@%@", MENU_URL, @"show"];
    [NetRequest getRequestWithUrl:httpUrl parameter:parameter succeed:^(id response) {
        succeed(response);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end
// 菜谱根据名称查询
@implementation NetRequest (MenuName)

+ (void)getMenuNameRequestWithParameter:(NSDictionary *)parameter
                                succeed:(Succeed)succeed
                                failure:(Failure)failure {
    NSString *httpUrl = [NSString stringWithFormat:@"%@%@", MENU_URL, @"name"];
    [NetRequest getRequestWithUrl:httpUrl parameter:parameter succeed:^(id response) {
        succeed(response);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

@end


















